<?php

include_once("datafeed.php");

	if(isset($_GET['username'])){
		$username = $_GET['username'];
		$password = $_GET['password'];
		$ret = login($username, $password);
	}
	if(isset($_GET['logout'])){
		$logout = $_GET['logout'];
		if($logout == 'sim'){
			session_destroy();
		}
	}
?>
<!DOCTYPE HTML>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
		
		<link type="text/css" href="style/style.css" rel="stylesheet" />
		<link type="text/css" href="style/jquery-ui-1.8.21.custom.css" rel="stylesheet" />
		<script type="text/javascript" src="jss/jquery-1.7.2.dev.js"></script>
		<script type="text/javascript" src="jss/jquery.ui.datepicker.js"></script>
		
	</head>
	<body style="margin: 100px auto; width: 700px ">
		
		
		
		
		<?php 
		if(isset($_SESSION['user_id'])){
		?>
			<a href="?logout=sim">logout</a>
			<br/><br/>
			<?php 
			getUsers();
			?>
		<?php 
		}else{ ?>
		<form id="form" name="form" method="GET" enctype="application/x-www-form-urlencoded" action="">
			<table>
				<tr>
					<td>
						Username: 
					</td>
					<td>
						<input type="text" name="username"/>
					</td>
				</tr>
				
				<tr>
					<td>
						Passowrd: 
					</td>
					<td>
						<input type="password" name="password" id="password"/>
					</td>
				</tr>
				<tr>
					<td>
						 
					</td>
					<td>
						<input type="submit" value="login" id="submit"/>
					</td>
				</tr>
			</table>
			<input type="hidden" value="reg" name="act"/>
		</form>	
		<a href="register.php">register</a>
		<?php 
		}
		?>
		<div id="calendarwrapper" style=""></div>
		<div id="overlay"></div>
		
	</body>
</html>


